.class public Lrexsee/storage/RexseeZIP;
.super Ljava/lang/Object;
.source "RexseeZIP.java"

# interfaces
.implements Lrexsee/core/browser/clazz/JavascriptInterface;


# static fields
.field public static final BUFF_SIZE:I = 0x100000

.field private static final INTERFACE_NAME:Ljava/lang/String; = "ZIP"


# instance fields
.field private final mBrowser:Lrexsee/core/browser/Browser;

.field private mCompressLevel:I


# direct methods
.method public constructor <init>(Lrexsee/core/browser/Browser;)V
    .locals 1
    .param p1, "browser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 51
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 49
    const/4 v0, -0x1

    iput v0, p0, Lrexsee/storage/RexseeZIP;->mCompressLevel:I

    .line 52
    iput-object p1, p0, Lrexsee/storage/RexseeZIP;->mBrowser:Lrexsee/core/browser/Browser;

    .line 53
    return-void
.end method

.method static synthetic access$0(Lrexsee/storage/RexseeZIP;)Lrexsee/core/browser/Browser;
    .locals 1

    .prologue
    .line 48
    iget-object v0, p0, Lrexsee/storage/RexseeZIP;->mBrowser:Lrexsee/core/browser/Browser;

    return-object v0
.end method

.method static synthetic access$1(Lrexsee/storage/RexseeZIP;)I
    .locals 1

    .prologue
    .line 49
    iget v0, p0, Lrexsee/storage/RexseeZIP;->mCompressLevel:I

    return v0
.end method

.method static synthetic access$2(Lrexsee/storage/RexseeZIP;[Ljava/io/File;Ljava/util/zip/ZipOutputStream;Ljava/lang/String;)Z
    .locals 1

    .prologue
    .line 79
    invoke-direct {p0, p1, p2, p3}, Lrexsee/storage/RexseeZIP;->appendToZipArchive([Ljava/io/File;Ljava/util/zip/ZipOutputStream;Ljava/lang/String;)Z

    move-result v0

    return v0
.end method

.method static synthetic access$3(Lrexsee/storage/RexseeZIP;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    .locals 1

    .prologue
    .line 55
    invoke-direct {p0, p1, p2}, Lrexsee/storage/RexseeZIP;->zip2string(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method static synthetic access$4(Lrexsee/storage/RexseeZIP;Ljava/util/zip/ZipEntry;Ljava/lang/String;)Ljava/lang/String;
    .locals 1

    .prologue
    .line 64
    invoke-direct {p0, p1, p2}, Lrexsee/storage/RexseeZIP;->entry2json(Ljava/util/zip/ZipEntry;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method private appendToZipArchive(Ljava/io/File;Ljava/util/zip/ZipOutputStream;Ljava/lang/String;)Z
    .locals 10
    .param p1, "sourceFile"    # Ljava/io/File;
    .param p2, "zipout"    # Ljava/util/zip/ZipOutputStream;
    .param p3, "pathInZip"    # Ljava/lang/String;

    .prologue
    const/4 v9, 0x0

    .line 88
    :try_start_0
    new-instance v6, Ljava/lang/StringBuilder;

    invoke-static {p3}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v7

    invoke-direct {v6, v7}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {p3}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v7}, Ljava/lang/String;->length()I

    move-result v7

    if-nez v7, :cond_0

    const-string v7, ""

    :goto_0
    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {p1}, Ljava/io/File;->getName()Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p3

    .line 89
    invoke-virtual {p1}, Ljava/io/File;->isDirectory()Z

    move-result v6

    if-eqz v6, :cond_3

    .line 90
    invoke-virtual {p1}, Ljava/io/File;->listFiles()[Ljava/io/File;

    move-result-object v3

    .line 91
    .local v3, "fileList":[Ljava/io/File;
    array-length v6, v3

    move v7, v9

    :goto_1
    if-lt v7, v6, :cond_1

    .line 106
    .end local v3    # "fileList":[Ljava/io/File;
    :goto_2
    const/4 v6, 0x1

    .line 109
    :goto_3
    return v6

    .line 88
    :cond_0
    sget-object v7, Ljava/io/File;->separator:Ljava/lang/String;

    goto :goto_0

    .line 91
    .restart local v3    # "fileList":[Ljava/io/File;
    :cond_1
    aget-object v2, v3, v7

    .line 92
    .local v2, "file":Ljava/io/File;
    invoke-direct {p0, v2, p2, p3}, Lrexsee/storage/RexseeZIP;->appendToZipArchive(Ljava/io/File;Ljava/util/zip/ZipOutputStream;Ljava/lang/String;)Z

    move-result v8

    if-nez v8, :cond_2

    move v6, v9

    goto :goto_3

    .line 91
    :cond_2
    add-int/lit8 v7, v7, 0x1

    goto :goto_1

    .line 95
    .end local v2    # "file":Ljava/io/File;
    .end local v3    # "fileList":[Ljava/io/File;
    :cond_3
    const/high16 v6, 0x100000

    new-array v0, v6, [B

    .line 96
    .local v0, "buffer":[B
    new-instance v4, Ljava/io/BufferedInputStream;

    new-instance v6, Ljava/io/FileInputStream;

    invoke-direct {v6, p1}, Ljava/io/FileInputStream;-><init>(Ljava/io/File;)V

    const/high16 v7, 0x100000

    invoke-direct {v4, v6, v7}, Ljava/io/BufferedInputStream;-><init>(Ljava/io/InputStream;I)V

    .line 97
    .local v4, "in":Ljava/io/BufferedInputStream;
    new-instance v6, Ljava/util/zip/ZipEntry;

    invoke-direct {v6, p3}, Ljava/util/zip/ZipEntry;-><init>(Ljava/lang/String;)V

    invoke-virtual {p2, v6}, Ljava/util/zip/ZipOutputStream;->putNextEntry(Ljava/util/zip/ZipEntry;)V

    .line 99
    :goto_4
    invoke-virtual {v4, v0}, Ljava/io/BufferedInputStream;->read([B)I

    move-result v5

    .local v5, "realLength":I
    const/4 v6, -0x1

    if-ne v5, v6, :cond_4

    .line 102
    invoke-virtual {v4}, Ljava/io/BufferedInputStream;->close()V

    .line 103
    invoke-virtual {p2}, Ljava/util/zip/ZipOutputStream;->flush()V

    .line 104
    invoke-virtual {p2}, Ljava/util/zip/ZipOutputStream;->closeEntry()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_2

    .line 107
    .end local v0    # "buffer":[B
    .end local v4    # "in":Ljava/io/BufferedInputStream;
    .end local v5    # "realLength":I
    :catch_0
    move-exception v6

    move-object v1, v6

    .line 108
    .local v1, "e":Ljava/lang/Exception;
    iget-object v6, p0, Lrexsee/storage/RexseeZIP;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-virtual {p0}, Lrexsee/storage/RexseeZIP;->getInterfaceName()Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7, v1}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/Exception;)V

    move v6, v9

    .line 109
    goto :goto_3

    .line 100
    .end local v1    # "e":Ljava/lang/Exception;
    .restart local v0    # "buffer":[B
    .restart local v4    # "in":Ljava/io/BufferedInputStream;
    .restart local v5    # "realLength":I
    :cond_4
    const/4 v6, 0x0

    :try_start_1
    invoke-virtual {p2, v0, v6, v5}, Ljava/util/zip/ZipOutputStream;->write([BII)V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    goto :goto_4
.end method

.method private appendToZipArchive([Ljava/io/File;Ljava/util/zip/ZipOutputStream;Ljava/lang/String;)Z
    .locals 3
    .param p1, "sourceFiles"    # [Ljava/io/File;
    .param p2, "zipout"    # Ljava/util/zip/ZipOutputStream;
    .param p3, "pathInZip"    # Ljava/lang/String;

    .prologue
    .line 80
    const/4 v0, 0x0

    .local v0, "i":I
    :goto_0
    array-length v2, p1

    if-lt v0, v2, :cond_0

    .line 84
    const/4 v2, 0x1

    :goto_1
    return v2

    .line 81
    :cond_0
    aget-object v2, p1, v0

    invoke-direct {p0, v2, p2, p3}, Lrexsee/storage/RexseeZIP;->appendToZipArchive(Ljava/io/File;Ljava/util/zip/ZipOutputStream;Ljava/lang/String;)Z

    move-result v1

    .line 82
    .local v1, "rtn":Z
    if-nez v1, :cond_1

    const/4 v2, 0x0

    goto :goto_1

    .line 80
    :cond_1
    add-int/lit8 v0, v0, 0x1

    goto :goto_0
.end method

.method private entry2json(Ljava/util/zip/ZipEntry;Ljava/lang/String;)Ljava/lang/String;
    .locals 5
    .param p1, "entry"    # Ljava/util/zip/ZipEntry;
    .param p2, "encoding"    # Ljava/lang/String;

    .prologue
    .line 66
    :try_start_0
    const-string v1, "{"

    .line 67
    .local v1, "rtn":Ljava/lang/String;
    new-instance v2, Ljava/lang/StringBuilder;

    invoke-static {v1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v3

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v3, "\"name\":\""

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {p1}, Ljava/util/zip/ZipEntry;->getName()Ljava/lang/String;

    move-result-object v3

    invoke-direct {p0, v3, p2}, Lrexsee/storage/RexseeZIP;->zip2string(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, "\""

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    .line 68
    new-instance v2, Ljava/lang/StringBuilder;

    invoke-static {v1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v3

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v3, ",\"size\":"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {p1}, Ljava/util/zip/ZipEntry;->getSize()J

    move-result-wide v3

    invoke-virtual {v2, v3, v4}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    .line 69
    new-instance v2, Ljava/lang/StringBuilder;

    invoke-static {v1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v3

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v3, ",\"compressedSize\":"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {p1}, Ljava/util/zip/ZipEntry;->getCompressedSize()J

    move-result-wide v3

    invoke-virtual {v2, v3, v4}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    .line 70
    new-instance v2, Ljava/lang/StringBuilder;

    invoke-static {v1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v3

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v3, ",\"lastModification\":"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {p1}, Ljava/util/zip/ZipEntry;->getTime()J

    move-result-wide v3

    invoke-virtual {v2, v3, v4}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    .line 71
    new-instance v2, Ljava/lang/StringBuilder;

    invoke-static {v1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v3

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v3, ",\"isDirectory\":"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {p1}, Ljava/util/zip/ZipEntry;->isDirectory()Z

    move-result v3

    invoke-static {v3}, Ljava/lang/String;->valueOf(Z)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    .line 72
    new-instance v2, Ljava/lang/StringBuilder;

    invoke-static {v1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v3

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v3, "}"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v1

    move-object v2, v1

    .line 76
    .end local v1    # "rtn":Ljava/lang/String;
    :goto_0
    return-object v2

    .line 74
    :catch_0
    move-exception v2

    move-object v0, v2

    .line 75
    .local v0, "e":Ljava/lang/Exception;
    iget-object v2, p0, Lrexsee/storage/RexseeZIP;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-virtual {p0}, Lrexsee/storage/RexseeZIP;->getInterfaceName()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3, v0}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/Exception;)V

    .line 76
    const-string v2, "{}"

    goto :goto_0
.end method

.method private zip2string(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    .locals 3
    .param p1, "source"    # Ljava/lang/String;
    .param p2, "encoding"    # Ljava/lang/String;

    .prologue
    .line 56
    if-nez p1, :cond_0

    const-string v1, ""

    .line 60
    :goto_0
    return-object v1

    .line 58
    :cond_0
    :try_start_0
    new-instance v1, Ljava/lang/String;

    const-string v2, "8859_1"

    invoke-virtual {p1, v2}, Ljava/lang/String;->getBytes(Ljava/lang/String;)[B

    move-result-object v2

    invoke-direct {v1, v2, p2}, Ljava/lang/String;-><init>([BLjava/lang/String;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 59
    :catch_0
    move-exception v1

    move-object v0, v1

    .local v0, "e":Ljava/lang/Exception;
    move-object v1, p1

    .line 60
    goto :goto_0
.end method


# virtual methods
.method public compress(Ljava/lang/String;)Ljava/lang/String;
    .locals 7
    .param p1, "data"    # Ljava/lang/String;

    .prologue
    .line 123
    invoke-virtual {p1}, Ljava/lang/String;->getBytes()[B

    move-result-object v0

    .line 124
    .local v0, "bytes":[B
    new-instance v1, Ljava/util/zip/Deflater;

    iget v6, p0, Lrexsee/storage/RexseeZIP;->mCompressLevel:I

    invoke-direct {v1, v6}, Ljava/util/zip/Deflater;-><init>(I)V

    .line 125
    .local v1, "deflater":Ljava/util/zip/Deflater;
    invoke-virtual {v1, v0}, Ljava/util/zip/Deflater;->setInput([B)V

    .line 126
    invoke-virtual {v1}, Ljava/util/zip/Deflater;->finish()V

    .line 127
    array-length v6, v0

    new-array v5, v6, [B

    .line 128
    .local v5, "tmp":[B
    invoke-virtual {v1, v5}, Ljava/util/zip/Deflater;->deflate([B)I

    move-result v4

    .line 129
    .local v4, "size":I
    invoke-virtual {v1}, Ljava/util/zip/Deflater;->end()V

    .line 130
    if-nez v4, :cond_0

    const-string v6, ""

    .line 135
    :goto_0
    return-object v6

    .line 131
    :cond_0
    new-array v3, v4, [B

    .line 132
    .local v3, "rtn":[B
    const/4 v2, 0x0

    .local v2, "i":I
    :goto_1
    if-lt v2, v4, :cond_1

    .line 135
    invoke-static {v3}, Lrexsee/security/RexseeSecurity;->bytes2hex([B)Ljava/lang/String;

    move-result-object v6

    goto :goto_0

    .line 133
    :cond_1
    aget-byte v6, v5, v2

    aput-byte v6, v3, v2

    .line 132
    add-int/lit8 v2, v2, 0x1

    goto :goto_1
.end method

.method public getInheritInterface(Lrexsee/core/browser/Browser;)Lrexsee/core/browser/clazz/JavascriptInterface;
    .locals 0
    .param p1, "childBrowser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 39
    return-object p0
.end method

.method public getInterfaceName()Ljava/lang/String;
    .locals 2

    .prologue
    .line 35
    new-instance v0, Ljava/lang/StringBuilder;

    iget-object v1, p0, Lrexsee/storage/RexseeZIP;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v1, v1, Lrexsee/core/browser/Browser;->application:Lrexsee/core/application/RexseeApplication;

    iget-object v1, v1, Lrexsee/core/application/RexseeApplication;->resources:Lrexsee/core/application/Resource;

    iget-object v1, v1, Lrexsee/core/application/Resource;->prefix:Ljava/lang/String;

    invoke-static {v1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v1, "ZIP"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getLevel()I
    .locals 1

    .prologue
    .line 119
    iget v0, p0, Lrexsee/storage/RexseeZIP;->mCompressLevel:I

    return v0
.end method

.method public getNewInterface(Lrexsee/core/browser/Browser;)Lrexsee/core/browser/clazz/JavascriptInterface;
    .locals 1
    .param p1, "childBrowser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 43
    new-instance v0, Lrexsee/storage/RexseeZIP;

    invoke-direct {v0, p1}, Lrexsee/storage/RexseeZIP;-><init>(Lrexsee/core/browser/Browser;)V

    return-object v0
.end method

.method public gzip(Ljava/lang/String;Ljava/lang/String;)Z
    .locals 1
    .param p1, "source"    # Ljava/lang/String;
    .param p2, "target"    # Ljava/lang/String;

    .prologue
    const/4 v0, 0x1

    .line 166
    invoke-virtual {p0, p1, p2, v0, v0}, Lrexsee/storage/RexseeZIP;->gzip(Ljava/lang/String;Ljava/lang/String;ZZ)Z

    move-result v0

    return v0
.end method

.method public gzip(Ljava/lang/String;Ljava/lang/String;ZZ)Z
    .locals 4
    .param p1, "source"    # Ljava/lang/String;
    .param p2, "target"    # Ljava/lang/String;
    .param p3, "showProgress"    # Z
    .param p4, "cancelable"    # Z

    .prologue
    .line 169
    new-instance v0, Lrexsee/storage/RexseeZIP$1;

    invoke-direct {v0, p0, p1, p2}, Lrexsee/storage/RexseeZIP$1;-><init>(Lrexsee/storage/RexseeZIP;Ljava/lang/String;Ljava/lang/String;)V

    .line 195
    .local v0, "runnable":Lrexsee/core/browser/clazz/SyncTask$BooleanRunnable;
    if-eqz p3, :cond_0

    .line 196
    new-instance v1, Lrexsee/core/browser/clazz/SyncTask;

    invoke-direct {v1}, Lrexsee/core/browser/clazz/SyncTask;-><init>()V

    iget-object v2, p0, Lrexsee/storage/RexseeZIP;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-virtual {v1, v0, v2, p4}, Lrexsee/core/browser/clazz/SyncTask;->run(Lrexsee/core/browser/clazz/SyncTask$BooleanRunnable;Lrexsee/core/browser/Browser;Z)Z

    move-result v1

    .line 198
    :goto_0
    return v1

    :cond_0
    new-instance v1, Lrexsee/core/browser/clazz/SyncTask;

    invoke-direct {v1}, Lrexsee/core/browser/clazz/SyncTask;-><init>()V

    const/4 v2, 0x0

    const/4 v3, 0x0

    invoke-virtual {v1, v0, v2, v3}, Lrexsee/core/browser/clazz/SyncTask;->run(Lrexsee/core/browser/clazz/SyncTask$BooleanRunnable;Lrexsee/core/browser/Browser;Z)Z

    move-result v1

    goto :goto_0
.end method

.method public list(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    .locals 10
    .param p1, "source"    # Ljava/lang/String;
    .param p2, "encoding"    # Ljava/lang/String;

    .prologue
    const-string v9, "[]"

    .line 344
    invoke-static {p1}, Lrexsee/core/utilities/Utilities;->prepareReadFile(Ljava/lang/String;)Ljava/io/File;

    move-result-object v4

    .line 345
    .local v4, "zipFile":Ljava/io/File;
    if-nez v4, :cond_0

    .line 346
    iget-object v5, p0, Lrexsee/storage/RexseeZIP;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-virtual {p0}, Lrexsee/storage/RexseeZIP;->getInterfaceName()Ljava/lang/String;

    move-result-object v6

    new-instance v7, Ljava/lang/StringBuilder;

    const-string v8, "Error on reading ZIP file: "

    invoke-direct {v7, v8}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v7, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v7

    invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v5, v6, v7}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/String;)V

    .line 347
    const-string v5, "[]"

    move-object v5, v9

    .line 360
    :goto_0
    return-object v5

    .line 350
    :cond_0
    :try_start_0
    new-instance v3, Ljava/util/zip/ZipFile;

    invoke-direct {v3, v4}, Ljava/util/zip/ZipFile;-><init>(Ljava/io/File;)V

    .line 351
    .local v3, "zf":Ljava/util/zip/ZipFile;
    invoke-virtual {v3}, Ljava/util/zip/ZipFile;->entries()Ljava/util/Enumeration;

    move-result-object v1

    .line 352
    .local v1, "entries":Ljava/util/Enumeration;, "Ljava/util/Enumeration<*>;"
    const-string v2, ""

    .line 353
    .local v2, "rtn":Ljava/lang/String;
    :goto_1
    invoke-interface {v1}, Ljava/util/Enumeration;->hasMoreElements()Z

    move-result v5

    if-nez v5, :cond_1

    .line 357
    new-instance v5, Ljava/lang/StringBuilder;

    const-string v6, "["

    invoke-direct {v5, v6}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v5, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    const-string v6, "]"

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    goto :goto_0

    .line 354
    :cond_1
    const-string v5, ""

    invoke-virtual {v2, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v5

    if-nez v5, :cond_2

    new-instance v5, Ljava/lang/StringBuilder;

    invoke-static {v2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v6

    invoke-direct {v5, v6}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v6, ","

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    .line 355
    :cond_2
    new-instance v6, Ljava/lang/StringBuilder;

    invoke-static {v2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v5

    invoke-direct {v6, v5}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-interface {v1}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;

    move-result-object v5

    check-cast v5, Ljava/util/zip/ZipEntry;

    invoke-direct {p0, v5, p2}, Lrexsee/storage/RexseeZIP;->entry2json(Ljava/util/zip/ZipEntry;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v6, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v2

    goto :goto_1

    .line 358
    .end local v1    # "entries":Ljava/util/Enumeration;, "Ljava/util/Enumeration<*>;"
    .end local v2    # "rtn":Ljava/lang/String;
    .end local v3    # "zf":Ljava/util/zip/ZipFile;
    :catch_0
    move-exception v5

    move-object v0, v5

    .line 359
    .local v0, "e":Ljava/lang/Exception;
    iget-object v5, p0, Lrexsee/storage/RexseeZIP;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-virtual {p0}, Lrexsee/storage/RexseeZIP;->getInterfaceName()Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v5, v6, v0}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/Exception;)V

    .line 360
    const-string v5, "[]"

    move-object v5, v9

    goto :goto_0
.end method

.method public setLevel(I)V
    .locals 1
    .param p1, "compressLevel"    # I

    .prologue
    .line 116
    if-ltz p1, :cond_0

    const/16 v0, 0x9

    if-le p1, v0, :cond_1

    :cond_0
    const/4 v0, -0x1

    :goto_0
    iput v0, p0, Lrexsee/storage/RexseeZIP;->mCompressLevel:I

    .line 117
    return-void

    :cond_1
    move v0, p1

    .line 116
    goto :goto_0
.end method

.method public unCompress(Ljava/lang/String;)Ljava/lang/String;
    .locals 9
    .param p1, "data"    # Ljava/lang/String;

    .prologue
    const/4 v7, 0x0

    .line 138
    invoke-static {p1}, Lrexsee/security/RexseeSecurity;->hex2bytes(Ljava/lang/String;)[B

    move-result-object v1

    .line 139
    .local v1, "bytes":[B
    new-instance v4, Ljava/util/zip/Inflater;

    invoke-direct {v4}, Ljava/util/zip/Inflater;-><init>()V

    .line 140
    .local v4, "inflater":Ljava/util/zip/Inflater;
    invoke-virtual {v4, v1}, Ljava/util/zip/Inflater;->setInput([B)V

    .line 141
    new-array v6, v7, [B

    .line 142
    .local v6, "result":[B
    new-instance v5, Ljava/io/ByteArrayOutputStream;

    const/4 v7, 0x1

    invoke-direct {v5, v7}, Ljava/io/ByteArrayOutputStream;-><init>(I)V

    .line 144
    .local v5, "o":Ljava/io/ByteArrayOutputStream;
    const/16 v7, 0x400

    :try_start_0
    new-array v0, v7, [B

    .line 145
    .local v0, "buf":[B
    const/4 v3, 0x0

    .line 146
    .local v3, "got":I
    :goto_0
    invoke-virtual {v4}, Ljava/util/zip/Inflater;->finished()Z

    move-result v7

    if-eqz v7, :cond_0

    .line 150
    invoke-virtual {v4}, Ljava/util/zip/Inflater;->end()V

    .line 151
    invoke-virtual {v5}, Ljava/io/ByteArrayOutputStream;->toByteArray()[B

    move-result-object v6

    .line 152
    invoke-virtual {v5}, Ljava/io/ByteArrayOutputStream;->close()V

    .line 153
    new-instance v7, Ljava/lang/String;

    invoke-direct {v7, v6}, Ljava/lang/String;-><init>([B)V

    .line 161
    .end local v0    # "buf":[B
    .end local v3    # "got":I
    :goto_1
    return-object v7

    .line 147
    .restart local v0    # "buf":[B
    .restart local v3    # "got":I
    :cond_0
    invoke-virtual {v4, v0}, Ljava/util/zip/Inflater;->inflate([B)I

    move-result v3

    .line 148
    const/4 v7, 0x0

    invoke-virtual {v5, v0, v7, v3}, Ljava/io/ByteArrayOutputStream;->write([BII)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    .line 154
    .end local v0    # "buf":[B
    .end local v3    # "got":I
    :catch_0
    move-exception v7

    move-object v2, v7

    .line 155
    .local v2, "e":Ljava/lang/Exception;
    iget-object v7, p0, Lrexsee/storage/RexseeZIP;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-virtual {p0}, Lrexsee/storage/RexseeZIP;->getInterfaceName()Ljava/lang/String;

    move-result-object v8

    invoke-virtual {v7, v8, v2}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/Exception;)V

    .line 156
    invoke-virtual {v4}, Ljava/util/zip/Inflater;->end()V

    .line 158
    :try_start_1
    invoke-virtual {v5}, Ljava/io/ByteArrayOutputStream;->close()V
    :try_end_1
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_1

    .line 161
    :goto_2
    const-string v7, ""

    goto :goto_1

    .line 159
    :catch_1
    move-exception v7

    goto :goto_2
.end method

.method public unGzip(Ljava/lang/String;Ljava/lang/String;)Z
    .locals 1
    .param p1, "source"    # Ljava/lang/String;
    .param p2, "target"    # Ljava/lang/String;

    .prologue
    const/4 v0, 0x1

    .line 202
    invoke-virtual {p0, p1, p2, v0, v0}, Lrexsee/storage/RexseeZIP;->unGzip(Ljava/lang/String;Ljava/lang/String;ZZ)Z

    move-result v0

    return v0
.end method

.method public unGzip(Ljava/lang/String;Ljava/lang/String;ZZ)Z
    .locals 4
    .param p1, "source"    # Ljava/lang/String;
    .param p2, "target"    # Ljava/lang/String;
    .param p3, "showProgress"    # Z
    .param p4, "cancelable"    # Z

    .prologue
    .line 205
    new-instance v0, Lrexsee/storage/RexseeZIP$2;

    invoke-direct {v0, p0, p1, p2}, Lrexsee/storage/RexseeZIP$2;-><init>(Lrexsee/storage/RexseeZIP;Ljava/lang/String;Ljava/lang/String;)V

    .line 235
    .local v0, "runnable":Lrexsee/core/browser/clazz/SyncTask$BooleanRunnable;
    if-eqz p3, :cond_0

    .line 236
    new-instance v1, Lrexsee/core/browser/clazz/SyncTask;

    invoke-direct {v1}, Lrexsee/core/browser/clazz/SyncTask;-><init>()V

    iget-object v2, p0, Lrexsee/storage/RexseeZIP;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-virtual {v1, v0, v2, p4}, Lrexsee/core/browser/clazz/SyncTask;->run(Lrexsee/core/browser/clazz/SyncTask$BooleanRunnable;Lrexsee/core/browser/Browser;Z)Z

    move-result v1

    .line 238
    :goto_0
    return v1

    :cond_0
    new-instance v1, Lrexsee/core/browser/clazz/SyncTask;

    invoke-direct {v1}, Lrexsee/core/browser/clazz/SyncTask;-><init>()V

    const/4 v2, 0x0

    const/4 v3, 0x0

    invoke-virtual {v1, v0, v2, v3}, Lrexsee/core/browser/clazz/SyncTask;->run(Lrexsee/core/browser/clazz/SyncTask$BooleanRunnable;Lrexsee/core/browser/Browser;Z)Z

    move-result v1

    goto :goto_0
.end method

.method public unZip(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    .locals 7
    .param p1, "source"    # Ljava/lang/String;
    .param p2, "target"    # Ljava/lang/String;
    .param p3, "encoding"    # Ljava/lang/String;

    .prologue
    const/4 v5, 0x1

    .line 294
    const/4 v4, 0x0

    move-object v0, p0

    move-object v1, p1

    move-object v2, p2

    move-object v3, p3

    move v6, v5

    invoke-virtual/range {v0 .. v6}, Lrexsee/storage/RexseeZIP;->unZip(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZ)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public unZip(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZ)Ljava/lang/String;
    .locals 6
    .param p1, "source"    # Ljava/lang/String;
    .param p2, "target"    # Ljava/lang/String;
    .param p3, "encoding"    # Ljava/lang/String;
    .param p4, "nameContains"    # Ljava/lang/String;
    .param p5, "showProgress"    # Z
    .param p6, "cancelable"    # Z

    .prologue
    .line 297
    new-instance v0, Lrexsee/storage/RexseeZIP$4;

    move-object v1, p0

    move-object v2, p1

    move-object v3, p4

    move-object v4, p2

    move-object v5, p3

    invoke-direct/range {v0 .. v5}, Lrexsee/storage/RexseeZIP$4;-><init>(Lrexsee/storage/RexseeZIP;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    .line 337
    .local v0, "runnable":Lrexsee/core/browser/clazz/SyncTask$StringRunnable;
    if-eqz p5, :cond_0

    .line 338
    new-instance v1, Lrexsee/core/browser/clazz/SyncTask;

    invoke-direct {v1}, Lrexsee/core/browser/clazz/SyncTask;-><init>()V

    iget-object v2, p0, Lrexsee/storage/RexseeZIP;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-virtual {v1, v0, v2, p6}, Lrexsee/core/browser/clazz/SyncTask;->run(Lrexsee/core/browser/clazz/SyncTask$StringRunnable;Lrexsee/core/browser/Browser;Z)Ljava/lang/String;

    move-result-object v1

    .line 340
    :goto_0
    return-object v1

    :cond_0
    new-instance v1, Lrexsee/core/browser/clazz/SyncTask;

    invoke-direct {v1}, Lrexsee/core/browser/clazz/SyncTask;-><init>()V

    const/4 v2, 0x0

    const/4 v3, 0x0

    invoke-virtual {v1, v0, v2, v3}, Lrexsee/core/browser/clazz/SyncTask;->run(Lrexsee/core/browser/clazz/SyncTask$StringRunnable;Lrexsee/core/browser/Browser;Z)Ljava/lang/String;

    move-result-object v1

    goto :goto_0
.end method

.method public zip(Ljava/lang/String;Ljava/lang/String;)Z
    .locals 1
    .param p1, "source"    # Ljava/lang/String;
    .param p2, "target"    # Ljava/lang/String;

    .prologue
    const/4 v0, 0x1

    .line 243
    invoke-virtual {p0, p1, p2, v0, v0}, Lrexsee/storage/RexseeZIP;->zip(Ljava/lang/String;Ljava/lang/String;ZZ)Z

    move-result v0

    return v0
.end method

.method public zip(Ljava/lang/String;Ljava/lang/String;ZZ)Z
    .locals 4
    .param p1, "sources"    # Ljava/lang/String;
    .param p2, "target"    # Ljava/lang/String;
    .param p3, "showProgress"    # Z
    .param p4, "cancelable"    # Z

    .prologue
    .line 246
    new-instance v0, Lrexsee/storage/RexseeZIP$3;

    invoke-direct {v0, p0, p1, p2}, Lrexsee/storage/RexseeZIP$3;-><init>(Lrexsee/storage/RexseeZIP;Ljava/lang/String;Ljava/lang/String;)V

    .line 287
    .local v0, "runnable":Lrexsee/core/browser/clazz/SyncTask$BooleanRunnable;
    if-eqz p3, :cond_0

    .line 288
    new-instance v1, Lrexsee/core/browser/clazz/SyncTask;

    invoke-direct {v1}, Lrexsee/core/browser/clazz/SyncTask;-><init>()V

    iget-object v2, p0, Lrexsee/storage/RexseeZIP;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-virtual {v1, v0, v2, p4}, Lrexsee/core/browser/clazz/SyncTask;->run(Lrexsee/core/browser/clazz/SyncTask$BooleanRunnable;Lrexsee/core/browser/Browser;Z)Z

    move-result v1

    .line 290
    :goto_0
    return v1

    :cond_0
    new-instance v1, Lrexsee/core/browser/clazz/SyncTask;

    invoke-direct {v1}, Lrexsee/core/browser/clazz/SyncTask;-><init>()V

    const/4 v2, 0x0

    const/4 v3, 0x0

    invoke-virtual {v1, v0, v2, v3}, Lrexsee/core/browser/clazz/SyncTask;->run(Lrexsee/core/browser/clazz/SyncTask$BooleanRunnable;Lrexsee/core/browser/Browser;Z)Z

    move-result v1

    goto :goto_0
.end method
